package com.astrocsr.domain.model;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.astrocsr.common.helper.EncryptionHelper;
import com.astrocsr.domain.db.SearchResult;
import com.astrocsr.domain.web.AccountInfo;
import com.astrocsr.domain.web.GroupAccount;
import com.astrocsr.domain.web.GroupInfo;
import com.astrocsr.domain.web.UserInfo;

public class AccountModel extends BaseModel {

	private static final long serialVersionUID = 1L;

	// user
	private UserInfo userInfo;
	private AccountInfo accountInfo;
	private SearchResult<UserInfo> userInfoList;
	private SearchResult<GroupAccount> groupAccountList;
	private List<GroupInfo> groupInfoList;
	private List<GroupAccount> assignedGroupInfoList;
	
	// account
	private Long groupAccountId;
	private String selectedAccountNo;
	private String selectedGroupCode;
	
	// user
	private Long userId;
	private String email;
	private String groupCode;
	private String password;
	private String passwordVer;

	private int pwdMaxLen;
	private int pwdMinLen;

	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	public List<UserInfo> getUserInfoList() {
		return userInfoList;
	}

	public void setUserInfoList(SearchResult<UserInfo> userInfoList) {
		this.userInfoList = userInfoList;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPasswordVer() {
		return passwordVer;
	}

	public void setPasswordVer(String passwordVer) {
		this.passwordVer = passwordVer;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public int getPwdMaxLen() {
		return pwdMaxLen;
	}

	public void setPwdMaxLen(int pwdMaxLen) {
		this.pwdMaxLen = pwdMaxLen;
	}

	public int getPwdMinLen() {
		return pwdMinLen;
	}

	public void setPwdMinLen(int pwdMinLen) {
		this.pwdMinLen = pwdMinLen;
	}

	public String getGroupCode() {
		return groupCode;
	}

	public void setGroupCode(String groupCode) {
		this.groupCode = groupCode;
	}

	public SearchResult<GroupAccount> getGroupAccountList() {
		return groupAccountList;
	}

	public void setGroupAccountList(SearchResult<GroupAccount> groupAccountList) {
		this.groupAccountList = groupAccountList;
	}

	public String getSelectedAccountNo() {
		return selectedAccountNo;
	}
	public String getSelectedAccountNoEn() {
		return StringUtils.isNotBlank(selectedAccountNo)? EncryptionHelper.encrypt(selectedAccountNo): selectedAccountNo;
	}

	public void setSelectedAccountNo(String selectedAccountNo) {
		this.selectedAccountNo = selectedAccountNo;
	}

	public String getSelectedGroupCode() {
		return selectedGroupCode;
	}

	public void setSelectedGroupCode(String selectedGroupCode) {
		this.selectedGroupCode = selectedGroupCode;
	}

	public List<GroupInfo> getGroupInfoList() {
		return groupInfoList;
	}

	public void setGroupInfoList(List<GroupInfo> groupInfoList) {
		this.groupInfoList = groupInfoList;
	}

	public List<GroupAccount> getAssignedGroupInfoList() {
		return assignedGroupInfoList;
	}

	public void setAssignedGroupInfoList(List<GroupAccount> assignedGroupInfoList) {
		this.assignedGroupInfoList = assignedGroupInfoList;
	}

	public AccountInfo getAccountInfo() {
		return accountInfo;
	}

	public void setAccountInfo(AccountInfo accountInfo) {
		this.accountInfo = accountInfo;
	}

	public Long getGroupAccountId() {
		return groupAccountId;
	}

	public void setGroupAccountId(Long groupAccountId) {
		this.groupAccountId = groupAccountId;
	}
}
